﻿using System;

namespace JESAI.Core.Exceptions
{
    /// <summary>
    /// JESAI框架异常
    /// </summary>
    public class JESAIFrameworkException : JESAIException
    {
        /// <summary>
        /// 框架标识
        /// </summary>
        private const string JESAIFrameworkFlag = "JESAI_FRM_FLG";

        /// <summary>
        /// 框架内部消息
        /// </summary>
        private const string FrameworkInnerMessage = "JESAI框架内部异常";

        /// <summary>
        /// 初始化一个<see cref="JESAIFrameworkException"/>类型的实例
        /// </summary>
        public JESAIFrameworkException() : this(FrameworkInnerMessage) { }

        /// <summary>
        /// 初始化一个<see cref="JESAIFrameworkException"/>类型的实例
        /// </summary>
        /// <param name="errorMessage">错误消息</param>
        public JESAIFrameworkException(string errorMessage) : this(DefaultErrorCode, errorMessage)
        {
        }

        /// <summary>
        /// 初始化一个<see cref="JESAIFrameworkException"/>类型的实例
        /// </summary>
        /// <param name="errorCode">错误码</param>
        /// <param name="errorMessage">错误消息</param>
        /// <param name="innerException">内部异常</param>
        public JESAIFrameworkException(long errorCode, string errorMessage, Exception innerException = null) : base(errorCode, errorMessage, JESAIFrameworkFlag, innerException)
        {
        }
    }
}
